package cn.dust.design.pattern.creational.factorymethod;

import java.lang.reflect.InvocationTargetException;

/**
 * @Author: dust
 * @Date: 2019/11/25 13:34
 */
public abstract class HeroFactory {

    public abstract Hero getHero();

//    public Hero chuansong(Class c){
//        Hero hero=null;
//        try {
//            hero=(Hero)Class.forName(c.getName()).getDeclaredConstructor().newInstance();
//        } catch (InstantiationException e) {
//            e.printStackTrace();
//        } catch (IllegalAccessException e) {
//            e.printStackTrace();
//        } catch (InvocationTargetException e) {
//            e.printStackTrace();
//        } catch (NoSuchMethodException e) {
//            e.printStackTrace();
//        } catch (ClassNotFoundException e) {
//            e.printStackTrace();
//        }
//        return hero;
//    }


}
